﻿/* ============================================================================== 
 * 功能描述：MainMap 
 * 创 建 者：Administrator
 * 创建日期：2016/5/2 20:41:06 
 * ==============================================================================*/

using System;
using System.Collections.Generic;
using UnityEngine;

public class MainMap:Map
{
    protected override void OnLoadMap()
    {
        for (int i = 0; i < map.layers.Count; i++)
        {
            if (map.layers[i].name.Equals("Trigger"))
            {
                List<int> data = map.layers[i].data;
                for (int j = 0; j < data.Count; j++)
                {
                    int x = GetXByIndex(j);
                    int y = GetYByIndex(j);
                    Node node = new Node(x, y, GetPosByIndex(j));
                    if (data[j] > 0)
                    {
                        if (data[j] == map.GetTilesetsByName("Background").firstgid)
                        {
                            node.canWalk = true;
                        }
                        else if (data[j] == map.GetTilesetsByName("backroom_bed_1").firstgid)
                        {

                        }
                        else if (data[j] == map.GetTilesetsByName("backroom_bookrack_1").firstgid)
                        {

                        }
                        else if (data[j] == map.GetTilesetsByName("backroom_desk_1_0").firstgid)
                        {

                        }
                        else if (data[j] == map.GetTilesetsByName("camp_shop_3").firstgid)
                        {

                        }
                    }
                }
            }
        }
    }
}
